home *** CD-ROM | disk | FTP | other *** search
- #ifndef FWTRYBLO_H
- #define FWTRYBLO_H
- //========================================================================================
- //
- // File: FWTryBlo.h
- // Release Version: $ 1.0d1 $
- //
- // Creation Date: 3/28/94
- //
- // Copyright: © 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #include <setjmp.h>
-
- #ifdef FW_BUILD_WIN32S
- // [?KVV] Symantec C++ hack: setjmp.h defines setjmp to Catch and longjmp to Throw
- // which is not valid for Win32. Fortunately, it seems that we can use
- // standard library setjmp/longjmp. We just need to declare them.
- #undef setjmp
- int __CLIB setjmp(jmp_buf);
- #undef longjmp
- void __CLIB longjmp(jmp_buf, int);
- #endif
-
- #ifndef FWEXCTAS_H
- #include "FWExcTas.h"
- #endif
-
- //========================================================================================
- // CLASS _FW_CTryBlockContext
- //========================================================================================
-
- class _FW_CTryBlockContext
- {
- public:
- _FW_CTryBlockContext(FW_SPrivExceptionGlobals& globals, jmp_buf buffer);
- ~_FW_CTryBlockContext();
-
- void *operator new(size_t, void *);
- void operator delete(void *);
-
- FW_SPrivExceptionGlobals& fGlobals;
- class _FW_CTryBlockContext *fPriorContext;
- _FW_StackEntries fDeleteStackLevel;
- jmp_buf *fJumpBuffer;
- short fIsActive;
-
- #ifdef FW_DEBUG
- short fAutomaticsInMyScope;
- unsigned short fTraceDepth;
- void CheckClassInvariants(FW_SPrivExceptionGlobals& globals);
- #endif
-
- private:
-
- static _FW_CTryBlockContext *MakeCurrent(FW_SPrivExceptionGlobals& globals,
- _FW_CTryBlockContext *context);
-
- };
-
- //----------------------------------------------------------------------------------------
- // _FW_CTryBlockContext::operator new
- //----------------------------------------------------------------------------------------
-
- inline void* _FW_CTryBlockContext::operator new(size_t, void *ptr)
- {
- return ptr;
- }
-
- //----------------------------------------------------------------------------------------
- // _FW_CTryBlockContext::operator delete
- //----------------------------------------------------------------------------------------
-
- inline void _FW_CTryBlockContext::operator delete(void *)
- {
- }
-
- #endif
-